<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/10 0010
 * Time: 上午 9:50
 */
namespace app\controller;
class message extends \core\lss {
    //留言列表-首页视图
    public function msg_list(){
        $model = new \app\model\message();
        $res = $model->msgList();
        $this->assign('list',$res);
        $this->display('index.html');
    }
    //添加视图
    public function msg_add(){
        $this->display('add.html');
    }
    //添加操作
    public function do_add(){
        $data = $_POST;
        $res = false;
        if ($data['title'] && $data['content']){
            $model = new \app\model\message();
            $res = $model->msgAdd($data);
        }

        if ($res){
            jump('/message/msg_list');
        }else{
            jump('/message/msg_add');
        }
    }
}